import 'element-ui/lib/theme-chalk/index.css';
import '@/styles/index.scss';

import App from '@/App.vue';
import BaseComponent from '@/components/common/BaseComponent';
import SvgIcon from '@/components/common/SvgIcon.vue';
import {formatDelta, formatFileSize} from '@/utils/common_utils';
import Element from 'element-ui';
import Vue from 'vue';
import VueClipBoard from 'vue-clipboard2';
import {ElMessageOptions} from 'element-ui/types/message';

export const EmptyComponent = {
  render() {
    return <div/>;
  }
};

export const _404Component = {
  render() {
    return <h1>404 NOT FOUND</h1>;
  }
};

Vue.config.productionTip = false;
Vue.use(Element);
Vue.use(VueClipBoard);
Vue.component('SvgIcon', SvgIcon);
Vue.filter('fileSize', formatFileSize);
Vue.filter('delta', formatDelta);

const msg = Vue.prototype.$message;
Vue.prototype.$message = function (options: ElMessageOptions) {
  options.offset = 50;
  return msg(options);
};

export const bus = new BaseComponent();

export const app = new Vue({render: h => h(App)}).$mount('#app');
